// 颜色
$primaryColor: #007bff;
$primartHoverColor: #74c0fc;
$primaryActiveColor: #1357e8;
$whiteColor: #ffffff;
$btn-color-black: #000000;
$btn-color-gary: #e0e0e0;
//透明
$btn-bg-transparent: transparent;
// 大小
$btn-padding: 10px 20px;
$btn-radius: 5px;
$bt-border-radius: 5px;
// 尺寸
$btn-font-lg-size: 16px;
$btn-font-md-size: 12px;
$btn-font-sm-size: 10px;


// 主按钮样式
$btn-primary-style: (
    background-color: $primaryColor,
    color: $whiteColor,
    font-size: $btn-font-lg-size,
    padding: $btn-padding,
    border-radius: $btn-radius,
    border: none,
    transition: all 0.3s ease-in-out
);

.btn-primary {
    @each $proerty, $value in $btn-primary-style {
        #{$proerty}: $value;
    }

    &:hover {
        background-color: darken($primartHoverColor, 20%);
    }

    &:active {
        color: $btn-color-black;
    }
}

// 默认按钮样式
$btn-default-style: (
    background-color: $whiteColor,
    color: $btn-color-black,
    font-size: $btn-font-lg-size,
    padding: $btn-padding,
    border: 1px solid $btn-color-gary,
    border-radius: $bt-border-radius,
    transition: all 0.3s ease-in-out
);

.btn-default {
    @each $proerty, $value in $btn-default-style {
        #{$proerty}: $value;
    }

    &:hover {
        color: darken($primartHoverColor, 20%);
        border: 1px solid darken($primartHoverColor, 20%);
    }

    &:active {
        @each $proerty, $value in $btn-default-style {
            #{$proerty}: $value;
        }
    }
}

// 虚线按钮样式
$btn-dashed-style: (
    background-color: $btn-bg-transparent,
    color: $btn-color-black,
    font-size: $btn-font-lg-size,
    padding: $btn-padding,
    border: 1px dashed $btn-color-gary,
    border-radius: $bt-border-radius,
    transition: all 0.3s ease-in-out
);

.btn-dashed {
    @each $property, $value in $btn-dashed-style {
        #{$property}: $value;
    }

    &:hover {
        color: darken($primartHoverColor, 20%);
        border: 1px dashed darken($primartHoverColor, 20%);
    }

    &:active {
        @each $property, $value in $btn-dashed-style {
            #{$property}: $value;
        }
    }
}

//  文本按钮样式
$btn-text-styles: (
    background-color: transparent,
    color: $primaryColor,
    border: none,
    padding: $btn-padding,
    font-size: $btn-font-lg-size,
    text-decoration: none,
    transition: all 0.3s ease-in-out
);


// 文本按钮样式
.btn-text {
    @each $property, $value in $btn-text-styles {
        #{$property}: $value;
    }

    &:hover {
        background-color: $btn-color-gary;
        color: $btn-color-black;
        padding: 10px 20px;
        font-size: $btn-font-lg-size;
        border-radius: 5px;
        border: 1px solid $btn-color-gary;
        box-sizing: border-box;
    }

    &:active {
        @each $property, $value in $btn-text-styles {
            #{$property}: $value;
        }
    }
}

//  链接按钮样式    
$btn-link-styles: (
    background-color: transparent,
    color: $primaryColor,
    border: none,
    font-size: $btn-font-lg-size,
    text-decoration: none,
    transition: all 0.3s ease-in-out
);

// 链接按钮样式
.btn-link {
    @each $property, $value in $btn-link-styles {
        #{$property}: $value;
    }

    &:hover {
        color: darken($primartHoverColor, 5%);
    }

    &:active {
        @each $property, $value in $btn-link-styles {
            #{$property}: $value;
        }
    }
}

// 大号
.btn-lg {
    font-size: $btn-font-lg-size;

    &:hover {
        font-size: $btn-font-lg-size;
    }

    &:active {
        font-size: $btn-font-lg-size;
    }
}

//  中号 、默认号
.btn-md {
    font-size: $btn-font-md-size;

    &:hover {
        font-size: $btn-font-md-size;
    }

    &:active {
        font-size: $btn-font-md-size;
    }
}

//   小号
.btn-sm {
    font-size: $btn-font-sm-size;

    &:hover {
        font-size: $btn-font-sm-size;
    }

    &:active {
        font-size: $btn-font-sm-size;
    }
}

// 警告
.btn-warning {
    background-color: #ffc107;
    color: $whiteColor;
    padding: $btn-padding;

    &:hover {
        background-color: darken(#ffee6f, 20%);
    }

    &:active {
        color: $btn-color-black;
    }
}

// 危险
.btn-danger {
    background-color: #dc3545;
    color: $whiteColor;
    padding: $btn-padding;
    border-radius: $btn-radius;

    &:hover {
        background-color: darken(#dc3545, 20%);
    }

    &:active {
        color: $btn-color-black;
    }
}

// 圆的
.btn-circle {
    border-radius: 50%;
    padding: 10px 20px;
    width: 50px;
    height: 50px;
    line-height: 30px;
    text-align: center;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;

    &:hover {
        background-color: darken($primartHoverColor, 20%);
    }

    &:active {
        color: $btn-color-black;
    }
}

// 正方形的
.btn-square {
    border-radius: 0;
    padding: 10px 20px;
    width: 50px;
    height: 50px;
    line-height: 30px;
    text-align: center;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;

    &:hover {
        background-color: darken($primartHoverColor, 20%);
    }

    &:active {
        color: $btn-color-black;
    }
}

// 按钮加载动画
.btn-loading {
    position: relative;

    &:after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -10px;
        margin-left: -10px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 2px solid #fff;
        border-top-color: transparent;
        animation: btn-loading 0.75s linear infinite;
    }

    @keyframes btn-loading {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }
}
.btn-disabled{
    opacity: 0.5;
    cursor: not-allowed;
    
}